package tuanda.soict.firstsun.DataPackage;

/**
 * @author tuanda_soict_hut
 * @version 0.0.2
 * @since 11-9-2012
 */
public enum AbilityDataSet implements CommonConstants,AbilityList {

    NOSKILL(AbilityList.NO_SKILL, "NO_NAME", 0, 0, AFFECT_BOTH),
    //BASE RANK = (RANGE-1)*5 + AREA*5 + CUSTOM
    BLESS(AbilityList.BLESS, "BLESS", 1, 2, AFFECT_ALLY),
    CURE(AbilityList.CURE, "CURE", 1, 1, AFFECT_ALLY),
    HASTE(AbilityList.HASTE, "HASTE", 1, 2, AFFECT_ALLY),
    PRAY(AbilityList.PRAY, "PRAY", 1, 2, AFFECT_ALLY),
    //
    LIGHTNING(AbilityList.LIGHTNING, "LIGHTNING", 3, 1, AFFECT_ENEMY),
    FIREBALL(AbilityList.FIREBALL, "FIREBALL", 2, 2, AFFECT_ENEMY),
    EARTHQUAKE(AbilityList.EARTHQUAKE, "EARTHQUAKE", 2, 3, AFFECT_ENEMY),
    BLIZZARD(AbilityList.BLIZZARD, "BLIZZARD", 2, 3, AFFECT_ENEMY),
    //
    DEFEND(AbilityList.DEFEND, "DEFEND", 1, 1, AFFECT_SELF),
    RUN(AbilityList.RUN, "RUN", 1, 1, AFFECT_SELF),
    CHARGE(AbilityList.CHARGE, "CHARGE", 1, 1, AFFECT_SELF),
    CONCENTRATE(AbilityList.CONCENTRATE, "CONCENTRATE", 1, 1, AFFECT_SELF),
    //
    FIRST_AID(AbilityList.FIRST_AID, "FIRST_AID", 1, 1, AFFECT_SELF),
    CURSE(AbilityList.CURSE, "CURSE", 1, 1, AFFECT_ENEMY),
    TRANSFORM(AbilityList.TRANSFORM, "TRANSFORM", 1, 1, AFFECT_SELF),
    RETRANSFORM(AbilityList.RETRANSFORM, "RETRANSFORM", 1, 1, AFFECT_SELF),
    //
    BURN(AbilityList.BURN,"BURN", 2, 1, AFFECT_ENEMY),
    SLOW(AbilityList.SLOW, "SLOW", 2, 1, AFFECT_ENEMY),
    POISON(AbilityList.POISON, "POISON", 2, 1, AFFECT_ENEMY),
    EPIPHANY(AbilityList.EPIPHANY, "EPIPHANY", 2, 1, AFFECT_ALLY),
    //
    MERCY(AbilityList.MERCY, "MERCY", 2, 1, AFFECT_ALLY),
    RESURRECT(AbilityList.RESURRECT, "RESURRECT", 3, 1, AFFECT_ALLY),
    PROMOTE(AbilityList.PROMOTE, "PROMOTE", 1, 1, AFFECT_SELF),
    SECOND_CHANCE(AbilityList.SECOND_CHANCE, "SECOND_CHANCE", 3, 1, AFFECT_ALLY),
    //
    STUN(AbilityList.STUN, "STUN", 2, 1, AFFECT_ENEMY),
    DISABLE(AbilityList.DISABLE, "DISABLE", 2, 1, AFFECT_ENEMY),
    SLEEP(AbilityList.SLEEP, "SLEEP", 3, 1, AFFECT_ENEMY),
    SCHOLAR(AbilityList.SCHOLAR, "SCHOLAR", 1, 1, AFFECT_ALLY);
    //
    private final int ID;
    private final String abilityName;
    private final int abilityRange;
    private final int abilityArea;
    private final int abilityAffect;

    private AbilityDataSet(int id, String name, int range, int area, int affect) {
        ID = id;
        abilityName = name;
        abilityArea = area;
        abilityRange = range;
        abilityAffect = affect;
    }

    public final String getName() {
        return this.abilityName;
    }

    public final int getID() {
        return this.ID;
    }

    public final int getAbilityArea() {
        return this.abilityArea;
    }

    public final int getAbilityRange() {
        return this.abilityRange;
    }

    public final int getAbilityAffect() {
        return this.abilityAffect;
    }

    public final AbilityDataSet getAbility(int index) {
        for (AbilityDataSet ability : AbilityDataSet.values()) {
            if (ability.getID() == index) {
                return ability;
            }
        }
        return null;
    }
}
